home *** CD-ROM | disk | FTP | other *** search
/ Champak 52 / Volume 52 - JOGO DISK .iso / Games / dark_brown_eyes.swf / scripts / frame_2 / DoAction.as
Text File  |  2007-09-26  |  9KB  |  289 lines

  1. function sd()
  2. {
  3.    ggame_dress1_lc = new LocalConnection();
  4.    ggame_dress1_lc.send("lc_name","methodToExecute",buy_str);
  5. }
  6. stop();
  7. var m_name = ["one","up","down","shoes","head","eye","neck","ear","bag","foot"];
  8. var one_dname = "";
  9. var up_dname = "";
  10. var down_dname = "";
  11. var shoes_dname = "";
  12. var head_dname = "";
  13. var eye_dname = "";
  14. var neck_dname = "";
  15. var ear_dname = "";
  16. var bag_dname = "";
  17. var foot_dname = "";
  18. var highest_depth = 0;
  19. make_drag = function()
  20. {
  21.    var _loc4_ = 0;
  22.    while(_loc4_ < 12)
  23.    {
  24.       var _loc3_ = 0;
  25.       while(_loc3_ < m_name.length)
  26.       {
  27.          _root[m_name[_loc3_] + "_" + _loc4_].odepth = _root[m_name[_loc3_] + "_" + _loc4_].getDepth();
  28.          _root[m_name[_loc3_] + "_" + _loc4_].ox = _root[m_name[_loc3_] + "_" + _loc4_]._x;
  29.          _root[m_name[_loc3_] + "_" + _loc4_].oy = _root[m_name[_loc3_] + "_" + _loc4_]._y;
  30.          _root[m_name[_loc3_] + "_" + _loc4_].onPress = function()
  31.          {
  32.             highest_depth++;
  33.             this.swapDepths(highest_depth);
  34.             this.startDrag();
  35.          };
  36.          _root[m_name[_loc3_] + "_" + _loc4_].onRelease = function()
  37.          {
  38.             if(this._droptarget == "/game_ava/hidden_area")
  39.             {
  40.                drop(this._name);
  41.             }
  42.             else
  43.             {
  44.                move_f(this._name,this.ox,this.oy);
  45.             }
  46.             this.stopDrag();
  47.          };
  48.          _root[m_name[_loc3_] + "_" + _loc4_].onReleaseOutside = function()
  49.          {
  50.             if(this._droptarget == "/game_ava/hidden_area")
  51.             {
  52.                drop(this._name);
  53.             }
  54.             else
  55.             {
  56.                move_f(this._name,this.ox,this.oy);
  57.             }
  58.             this.stopDrag();
  59.          };
  60.          _loc3_ = _loc3_ + 1;
  61.       }
  62.       _loc4_ = _loc4_ + 1;
  63.    }
  64. };
  65. drop = function(drop_name)
  66. {
  67.    so2.start(0,1);
  68.    var _loc2_ = drop_name.indexOf("_");
  69.    _root[drop_name]._visible = false;
  70.    _root.game_ava[drop_name.slice(0,_loc2_) + "_m"].gotoAndStop(parseInt(drop_name.slice(_loc2_ + 1,_loc2_ + 3)) + 2);
  71.    if(drop_name.slice(0,_loc2_) == "up")
  72.    {
  73.       game_ava.underwear_up._visible = false;
  74.       _root[one_dname]._visible = true;
  75.       _root.game_ava.one_m.gotoAndStop(1);
  76.       move_f(one_dname,_root[one_dname].ox,_root[one_dname].oy);
  77.       if(one_dname != "")
  78.       {
  79.          game_ava.underwear_down._visible = true;
  80.       }
  81.       one_dname = "";
  82.    }
  83.    else if(drop_name.slice(0,_loc2_) == "down")
  84.    {
  85.       game_ava.underwear_down._visible = false;
  86.       _root[one_dname]._visible = true;
  87.       _root.game_ava.one_m.gotoAndStop(1);
  88.       move_f(one_dname,_root[one_dname].ox,_root[one_dname].oy);
  89.       if(one_dname != "")
  90.       {
  91.          game_ava.underwear_up._visible = true;
  92.       }
  93.       one_dname = "";
  94.    }
  95.    else if(drop_name.slice(0,_loc2_) == "one")
  96.    {
  97.       game_ava.underwear_up._visible = false;
  98.       game_ava.underwear_down._visible = false;
  99.       _root[up_dname]._visible = true;
  100.       _root.game_ava.up_m.gotoAndStop(1);
  101.       move_f(up_dname,_root[up_dname].ox,_root[up_dname].oy);
  102.       _root[down_dname]._visible = true;
  103.       _root.game_ava.down_m.gotoAndStop(1);
  104.       move_f(down_dname,_root[down_dname].ox,_root[down_dname].oy);
  105.       up_dname = "";
  106.       down_dname = "";
  107.    }
  108.    _root[_root[drop_name.slice(0,_loc2_) + "_dname"]]._visible = true;
  109.    move_f(_root[drop_name.slice(0,_loc2_) + "_dname"],_root[_root[drop_name.slice(0,_loc2_) + "_dname"]].ox,_root[_root[drop_name.slice(0,_loc2_) + "_dname"]].oy);
  110.    _root[drop_name.slice(0,_loc2_) + "_dname"] = drop_name;
  111. };
  112. move_f = function(dr_name, xx, yy)
  113. {
  114.    _root[dr_name].swapDepths(_root[dr_name].odepth);
  115.    var _loc4_ = new mx.transitions.Tween(_root[dr_name],"_x",mx.transitions.easing.Back.easeOut,_root[dr_name]._x,xx,10);
  116.    var _loc3_ = new mx.transitions.Tween(_root[dr_name],"_y",mx.transitions.easing.Back.easeOut,_root[dr_name]._y,yy,10);
  117. };
  118. ava_default = function()
  119. {
  120.    var _loc2_ = 0;
  121.    while(_loc2_ < m_name.length)
  122.    {
  123.       _root[_root[m_name[_loc2_] + "_dname"]]._visible = true;
  124.       _root.game_ava[m_name[_loc2_] + "_m"].gotoAndStop(1);
  125.       move_f(_root[m_name[_loc2_] + "_dname"],_root[_root[m_name[_loc2_] + "_dname"]].ox,_root[_root[m_name[_loc2_] + "_dname"]].oy);
  126.       _root[m_name[_loc2_] + "_dname"] = "";
  127.       _loc2_ = _loc2_ + 1;
  128.    }
  129.    game_ava.underwear_up._visible = true;
  130.    game_ava.underwear_down._visible = true;
  131. };
  132. game_play_bt.onRollOver = function()
  133. {
  134.    so1.start(0,1);
  135.    this.gotoAndStop(2);
  136. };
  137. game_play_bt.onRollOut = function()
  138. {
  139.    this.gotoAndStop(1);
  140. };
  141. game_play_bt.onPress = function()
  142. {
  143.    so1.start(0,1);
  144.    this.gotoAndStop(2);
  145. };
  146. game_play_bt.onRelease = function()
  147. {
  148.    this.gotoAndStop(1);
  149.    gotoAndStop(3);
  150. };
  151. game_play_bt.onReleaseOutside = function()
  152. {
  153.    this.gotoAndStop(1);
  154.    gotoAndStop(3);
  155. };
  156. ava_default_bt.onRollOver = function()
  157. {
  158.    so1.start(0,1);
  159.    this.gotoAndStop(2);
  160. };
  161. ava_default_bt.onRollOut = function()
  162. {
  163.    this.gotoAndStop(1);
  164. };
  165. ava_default_bt.onPress = function()
  166. {
  167.    so1.start(0,1);
  168.    this.gotoAndStop(2);
  169. };
  170. ava_default_bt.onRelease = function()
  171. {
  172.    this.gotoAndStop(1);
  173.    ava_default();
  174. };
  175. ava_default_bt.onReleaseOutside = function()
  176. {
  177.    this.gotoAndStop(1);
  178.    ava_default();
  179. };
  180. make_drag();
  181. var buy_str = "";
  182. var game_name = "N270009N400002";
  183. var game_value = "N";
  184. var buy_2 = ["N260017","N260018","N260019","N260020","N260021"];
  185. var buy_3 = ["N250073","N250074","N250075","N250076","N250077","N250078","N250079"];
  186. var buy_4 = ["N240071","N240072","N240073","N240074","N240075","N240076","N240077","N240078","N240079"];
  187. var buy_5 = ["N230072","N230073","N230074","N230075","N230076","N230077","N230078","N230079","N230080"];
  188. var buy_6 = ["N220043","N220044","N220045","N220046","N220047"];
  189. var buy_7 = ["N210017","N210018"];
  190. var buy_8 = ["N200016","N200017","N200018","N200019","N200020"];
  191. var buy_9 = ["N190011","N190012"];
  192. var buy_10 = [""];
  193. var buy_11 = ["N170054","N170055","N170056","N170057","N170058","N170059","N170060","N170061","N170062","N170063"];
  194. contest_join = function()
  195. {
  196.    foot_m = game_ava.foot_m._currentframe;
  197.    shoes_m = game_ava.shoes_m._currentframe;
  198.    down_m = game_ava.down_m._currentframe;
  199.    up_m = game_ava.up_m._currentframe;
  200.    one_m = game_ava.one_m._currentframe;
  201.    bag_m = game_ava.bag_m._currentframe;
  202.    neck_m = game_ava.neck_m._currentframe;
  203.    ear_m = game_ava.ear_m._currentframe;
  204.    eye_m = game_ava.eye_m._currentframe;
  205.    head_m = game_ava.head_m._currentframe;
  206.    var _loc4_ = new Array();
  207.    var _loc2_ = 0;
  208.    while(_loc2_ < avaStr.length / 7 - 1)
  209.    {
  210.       var _loc3_ = avaStr.slice((_loc2_ + 1) * 7,(_loc2_ + 1) * 7 + 7);
  211.       if((_loc3_.slice(1,3) < 17 || _loc3_.slice(1,3) > 32) && _loc3_.slice(1,3) != 13)
  212.       {
  213.          _loc4_.push(avaStr.slice((_loc2_ + 1) * 7,(_loc2_ + 1) * 7 + 7));
  214.       }
  215.       _loc2_ = _loc2_ + 1;
  216.    }
  217.    var _loc5_ = _loc4_.join("");
  218.    buy_str = game_name;
  219.    if(foot_m != 1)
  220.    {
  221.       buy_str += buy_2[foot_m - 2];
  222.    }
  223.    if(shoes_m != 1)
  224.    {
  225.       buy_str += buy_3[shoes_m - 2];
  226.    }
  227.    if(down_m != 1)
  228.    {
  229.       buy_str += buy_4[down_m - 1];
  230.    }
  231.    else if(one_m == 1 && down_m == 1)
  232.    {
  233.       buy_str += buy_4[0];
  234.    }
  235.    if(up_m != 1)
  236.    {
  237.       buy_str += buy_5[up_m - 1];
  238.    }
  239.    else if(one_m == 1 && up_m == 1)
  240.    {
  241.       buy_str += buy_5[0];
  242.    }
  243.    if(one_m != 1)
  244.    {
  245.       buy_str += buy_6[one_m - 2];
  246.    }
  247.    if(bag_m != 1)
  248.    {
  249.       buy_str += buy_7[bag_m - 2];
  250.    }
  251.    if(neck_m != 1)
  252.    {
  253.       buy_str += buy_8[neck_m - 2];
  254.    }
  255.    if(ear_m != 1)
  256.    {
  257.       buy_str += buy_9[ear_m - 2];
  258.    }
  259.    if(eye_m != 1)
  260.    {
  261.       buy_str += buy_10[eye_m - 2];
  262.    }
  263.    if(head_m != 1)
  264.    {
  265.       buy_str += buy_11[head_m - 2];
  266.    }
  267.    buy_str = avaStr.slice(0,2) + "1" + avaStr.slice(3,7) + _loc5_ + buy_str;
  268.    trace(buy_str);
  269.    getURL("JavaScript:ContestJoin(\'" + _root.buy_str + "\',\'" + _root.game_value + "\')","");
  270. };
  271. contest_bt.onRollOver = function()
  272. {
  273.    this.contest_bt_rollover.gotoAndStop(2);
  274. };
  275. contest_bt.onRollOut = function()
  276. {
  277.    this.contest_bt_rollover.gotoAndStop(1);
  278. };
  279. contest_bt.onPress = function()
  280. {
  281.    this.gotoAndStop(2);
  282. };
  283. contest_bt.onRelease = contest_bt.onReleaseOutside = function()
  284. {
  285.    this.contest_bt_rollover.gotoAndStop(1);
  286.    this.gotoAndStop(1);
  287.    contest_join();
  288. };
  289.